mex -lpthread -lserialport -luser32 -lsetupapi -lkernel32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -LD:/msys64/mingw64/x86_64-w64-mingw32/lib -LD:/msys64/mingw64/lib -LD:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0 -ID:/msys64/mingw64/include -LD:/msys64/mingw64/lib -I../Firmware ../Firmware/controller/mc_config.c ../Firmware/controller/motor.c ../Firmware/controller/controller.c ../Firmware/controller/foc.c ../Firmware/controller/svpwm.c ../Firmware/simulation/sim_bsp.c ../Firmware/simulation/sim_sfunc.c ../Firmware/simulation/sfunc_os.c ../Firmware/simulation/sfunc_core.c -O -output sim_foc  